<include file="public:top" />
<!--网站设置-->
<body class="body">
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="">
    <input type="hidden" name="menuid"  value="{$menuid}"/>
    <div class="layui-form-item" pane="">
        <label class="layui-form-label">用户注册</label>
        <div class="layui-input-block">
       <input type="radio" title="开启" <if condition="C('wkcms_reg_status') eq '1'">checked="checked"</if> value="1" name="setting[reg_status]">
       <input type="radio" title="关闭" <if condition="C('wkcms_reg_status') eq '0'">checked="checked"</if> value="0" name="setting[reg_status]">
        </div>
    </div>
    <div <if condition="C('wkcms_reg_status') eq 1">class="layui-hide"</else>class="layui-form-item"</if>>
        <label class="layui-form-label">关闭原因</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入关闭注册的原因" name="setting[reg_closed_reason]" id="closed_reason" class="layui-textarea">{:C('wkcms_reg_closed_reason')}</textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">默认介绍</label>
        <div class="layui-input-block">
            <input type="text" name="setting[user_intro_default]" placeholder="请输入" class="layui-input" value="{:C('wkcms_user_intro_default')}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">{:L('reg_protocol')}</label>
        <div class="layui-input-block">
             <textarea placeholder="请输入注册协议" name="setting[reg_protocol]" id="closed_reason" class="layui-textarea">{:C('wkcms_reg_protocol')}</textarea>
        </div>
        
    </div>

    <div class="layui-form-item">
        <label class=""></label>
        <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="upbtn">提交保存</button>
        </div>
    </div>
</form>

<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
//Demo
layui.use(['layer','jquery','form'], function () {
   // 操作对象
    var layer = layui.layer,$ = layui.jquery,form = layui.form;
  
  // 提交
    form.on('submit(upbtn)', function (data) {
        // 提交到方法 默认为本身
        $.post("{:u('global/edit')}",data.field,function(res){
            if(res.status.status ==  1){
                layer.msg(res.status.info,{time:1800},function(){
                  location.href = "{:u('global/index')}&type=register&menuid={$menuid}";
                });
            }else{
                layer.msg(res.status.info,{time:1800});
                // $('.verify_img').click();
            }
        });
        return false;
    });
});
</script>
</body>
</html>